package com.bwie.xujiahaonewstitle.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Toast;

import com.bwie.newstitlexujiahao.R;
import com.bwie.xujiahaonewstitle.adapter.FocusFragmentBaseAdapter;

/**
 * 项目名称
 * 类描述：
 * 创建人：${徐家浩}
 * 创建时间：2017/2/17 19:33
 * 修改人：${徐家浩}
 * 修改备注：
 */
public class FocusFragment extends Fragment {
    private View view;
    private ListView frg_care_lv;
    private LinearLayout frg_care_lv_head_ll;
    private FocusFragmentBaseAdapter mFocusFragmentBaseAdapter;
    private View v;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_care,null);

        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        frg_care_lv = (ListView) view.findViewById(R.id.frg_care_lv);
        v = View.inflate(getActivity(), R.layout.frg_care_lv_head,null);
        frg_care_lv.addHeaderView(v);
        frg_care_lv_head_ll = (LinearLayout) v.findViewById(R.id.frg_care_lv_head_ll);

        mFocusFragmentBaseAdapter = new FocusFragmentBaseAdapter();

        frg_care_lv.setAdapter(mFocusFragmentBaseAdapter);

        frg_care_lv_head_ll.setOnClickListener(new View.OnClickListener() {
            @SuppressLint("ShowToast")
            @Override
            public void onClick(View view) {
                Toast.makeText(getContext(),"你点了我", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
